﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MYSMRM.Common;

namespace MYSMRM.Model
{
    [Serializable]
    public class QSQuestion
    {
        [ColumnName("I_ID")]
        public virtual int ID { get; set; }
        [ColumnName("I_TOPIC_ID")]
        public virtual int TopicID { get; set; }
        [ColumnName("S_QUESTION")]
        public virtual String Question { get; set; }
        [ColumnName("I_SEQUENCE")]
        public virtual int Sequence { get; set; }

        [ColumnName("B_MULTI_SELECT")]
        public virtual bool MultiSelect { get; set; }

        [ColumnName("S_LAST_UPDATER")]
        public virtual String LastUpdater { get; set; }

        [ColumnName("D_LAST_UPDATE_DATE")]
        public virtual DateTime LastUpdateDate { get; set; }

        [ColumnName("S_CREATOR")]
        public virtual String Creator { get; set; }
        [ColumnName("D_CREATEDATE")]
        public virtual DateTime CreateDate { get; set; }

        //[ColumnName("Q_Topic")]
        //public virtual QSTopic Topic { get; set; }

        //[ColumnName("OPTION_LIST")]
        public virtual IList<QSOption> OptionList { get; set; }
        public virtual void AddList(IList<QSOption> list)
        {
            foreach (QSOption o in list)
            {
                o.ID = 0;
                //o.QuestionID = ID;
                OptionList.Add(o);
            }
        }
    }
}
